package com.ryan.controller;

import feign.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author raofy
 * @date 2021-10-20 17:19
 * @desc
 */
@RestController
public class MyTestController {

    @Autowired
    Client client;

    @GetMapping("fegin")
    public String getFegin() {
        return "Return: " + client.hello("didi");
    }

    @FeignClient("alibaba-nacos-discovery-server")
    interface Client {
        @GetMapping("/hello")
        String hello(@RequestParam String name);
    }
}
